﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="TopMenu.ascx.vb" Inherits="UserCuntrols_TopMenu" %>
<div style="position: absolute; top: 30px; right: 50px;">

    <script language="javascript" type="text/javascript">
    Login = function(IsLogedIn){
         if(IsLogedIn){
            window.location.href = '<%=ResolveUrl("~/LogOut.aspx") %>';
         }
         else{
            $('ifModal').src = '<%=ResolveUrl("~/Login.aspx") %>';
            $('progressBackgroundFilter').style.display="";
            $('progressBackgroundNotFilter').style.display = "";
            $('progressBackgroundNotFilter').style.height = "200px";
            $('ifModal').style.height = "200px";
         }
         return false;   
    };
    HideLogin = function(IsLogedIn,Username,Totalpoints){
            Close();
            if(IsLogedIn){
                $('<%=imgSignUp.clientId %>').style.display = "none";
                $('<%=imgLogin.clientID %>').src = '<%=ResolveUrl("~/images/SignOut.jpg") %>';
                $('<%=imgLogin.clientID %>').onclick = function(){Login(true);return false;};
                $('s_loginInformation').innerHTML = 'You are Logged in as: <span class="aspLabel">'+Username+'</span> Your total point(s): <span class="aspLabel">'+Totalpoints+'</span>';
            }
            return false;
        };
    SignUp = function(){
        $('ifModal').src = '<%=ResolveUrl("~/SignUp.aspx") %>';
        $('ifModal').style.height = "210px";
        $('progressBackgroundFilter').style.display="";
        $('progressBackgroundNotFilter').style.display = "";
        $('progressBackgroundNotFilter').style.height = "190px";
        $('progressBackgroundNotFilter').style.top = "240px";
        $('progressBackgroundNotFilter').style.bottom = "240px";
        $('progressBackgroundNotFilter').style.left = "400px";
        $('progressBackgroundNotFilter').style.right = "400px";
    };
    Trams = function(){
        $('ifModal').src = '<%=ResolveUrl("~/TermsOfUse.aspx") %>';
        $('ifModal').style.height = "550px";
        $('progressBackgroundFilter').style.display="";
        $('progressBackgroundNotFilter').style.display = "";
        $('progressBackgroundNotFilter').style.top = "40px";
        //$('progressBackgroundNotFilter').style.bottom = "10px";
        $('progressBackgroundNotFilter').style.left = "10px";
        $('progressBackgroundNotFilter').style.right = "10px";
        $('progressBackgroundNotFilter').style.height = "550px";
        //$('ifModal').style.overflow = "auto";
    };
    Close = function(){
        $('progressBackgroundFilter').style.display="none";
        $('progressBackgroundNotFilter').style.display = "none";
    };
    Profile = function(){
        $('ifModal').src = '<%=ResolveUrl("~/Profile.aspx") %>';
        $('ifModal').style.height = "320px";
        $('progressBackgroundFilter').style.display="";
        $('progressBackgroundNotFilter').style.display = "";
        $('progressBackgroundNotFilter').style.height = "320px";
    };
    </script>

    <span id="s_loginInformation"></span>
    <asp:Literal ID="litLogInText" runat="server" Text="You are Logged in as:"></asp:Literal>
    <asp:Label ID="lblLoginInformation" runat="server"></asp:Label>
    <asp:Literal ID="litPoints" runat="server"></asp:Literal>
    <asp:Image ID="imgLogin" runat="server" onclick="Login(false);return false;" Style="cursor: pointer;"
        ImageUrl="~/images/SignIn.jpg" Width="70" ImageAlign="AbsMiddle" />
    <asp:Image ID="imgSignUp" runat="server" onclick="Trams();return false;" Style="cursor: pointer;"
        ImageUrl="~/images/SignUp.jpg" Width="70" ImageAlign="AbsMiddle" />
    <asp:ImageButton PostBackUrl="~/YourGigiti.aspx" ID="imgProfile" runat="server" Style="cursor: pointer;"
        ImageUrl="~/images/envelop.gif" Width="36" AlternateText="Message" ToolTip="You have reached a milestone please go to Your Gigiti to claim a prize or click on the redeem button"
        ImageAlign="AbsMiddle" Visible="false" />

    <script language="javascript" type="text/javascript">
    <% if Session("Username") IsNot Nothing Then %>
    $('<%=imgLogin.clientID %>').onclick = function(){Login(true);return false;};
    <% End If %>
    </script>

</div>
<div class="topmenu" align="center">
    <center>
    <asp:HyperLink NavigateUrl="~/Default.aspx" runat="server" ID="HyperLink5"><asp:Image ID="imgWeb" runat="server" ImageUrl="~/images/WebButton.jpg" style="margin-left:4px;" Width="140px" AlternateText="Web" ToolTip="Web" CausesValidation="false" Height="50px" /></asp:HyperLink>
    &nbsp;
    <asp:HyperLink NavigateUrl="~/Image/Default.aspx" runat="server" ID="HyperLink6"><asp:Image ID="imgImage" runat="server" ImageUrl="~/images/Image.gif" Width="140px" AlternateText="Image" ToolTip="Image" CausesValidation="false" Height="50px" /></asp:HyperLink>
    &nbsp;
    <asp:HyperLink NavigateUrl="~/YourGigiti.aspx" runat="server" ID="lnkYourgigiti"><asp:Image ID="imgYourgigiti" runat="server" ImageUrl="~/images/YourGigiti.jpg" Width="140px" AlternateText="Your Gigiti" ToolTip="Your Gigiti" CausesValidation="false" Height="50px" /></asp:HyperLink>
    <asp:HyperLink NavigateUrl="~/Video/Default.aspx" runat="server" ID="HyperLink7"><asp:Image ID="imgvideo" runat="server" ImageUrl="~/images/Videos.jpg" Width="140px" AlternateText="Videos" CausesValidation="false" ToolTip="Videos" Height="50px" /></asp:HyperLink>
    &nbsp;
    <asp:HyperLink CssClass="news" NavigateUrl="~/News/Default.aspx" runat="server" ID="HyperLink8"><asp:Image ID="imgNews" runat="server" ImageUrl="~/images/News.jpg" Width="140px" AlternateText="News" ToolTip="News" CausesValidation="false" Height="50px" /></asp:HyperLink>
    &nbsp;
    </center>
</div>
<div id="div_RecentNews" class="fly-out" align="left" style="display:none;">
    <asp:GridView ID="newsRes" AutoGenerateColumns="False" BorderWidth="0" AllowPaging="False"
        PagerStyle-Mode="NextPrev" HorizontalAlign="Center" runat="server" Width="98%"
        GridLines="None">
        <HeaderStyle HorizontalAlign="Center" />
        <Columns>
            <asp:TemplateField HeaderText="Recent News" ItemStyle-Width="100%">
                <ItemTemplate>
                    -<asp:HyperLink ID="HyperLink2" runat="server" Target="_blank" NavigateUrl='<%#Eval("Url")%>'
                        ToolTip='<%#Eval("Summary")%>' Text='<%#Eval("title")%>' Style="line-height: 13px;"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <br />
    <div align="center">
        <asp:HyperLink NavigateUrl="~/News/Default.aspx?Q=World" ID="HyperLink1" runat="server">World</asp:HyperLink>
        &nbsp;<asp:HyperLink NavigateUrl="~/News/Default.aspx?Q=Finance" ID="HyperLink2"
            runat="server">Finance</asp:HyperLink>
        &nbsp;<asp:HyperLink NavigateUrl="~/News/Default.aspx?Q=entertainment" ID="HyperLink3"
            runat="server" style="color:#ffffff;">Entertainment</asp:HyperLink>
        &nbsp;<asp:HyperLink NavigateUrl="~/News/Default.aspx?Q=sports" ID="HyperLink4" runat="server">Sports</asp:HyperLink>
    </div>
</div>
<script language=javascript>
    //$('<%=HyperLink8.ClientID %>').title = "cssbody=[dvbdy] cssheader=[dvhdr] body=["+$("div_RecentNews").innerHTML+"] hideselects=[on]";
    ShowTooltip = function(e){
        if(!e) var e = window.event;
            var oBj = e.target?e.target:e.srcElement;
         
        $('div_RecentNews').style.display = "";
        //$('div_RecentNews').style.top = $('<%=HyperLink8.ClientID %>').offsetTop  + "px";
        $('div_RecentNews').style.left =  $('<%=HyperLink8.ClientID %>').offsetLeft - 200 + "px";
    };
    HideTooltip = function(e){
        $('div_RecentNews').style.display = "none";
    };
    $('<%=HyperLink8.ClientID %>').onmouseover = ShowTooltip;
    $('div_RecentNews').onmouseover = ShowTooltip;
    //$('div_RecentNews').onmouseout = HideTooltip;
    document.onclick = HideTooltip;
</script>
